﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace BSCore
{
    public class Map:DrawableGameComponent
    {
        public Vector2 Size { get; set; }

        public MapEntities MapEntities { get; set; }

        public Tiles Tiles { get; set; }

        public Camera2D Camera { get; set; }

        public SpriteBatch SpriteBatch { get; set; }

        public Map(BSGame game)
            :base(game)
        {

        }


        public override void Update(GameTime gameTime)
        {
            this.MapEntities.Update(gameTime);
            base.Update(gameTime);
        }
        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend,
                        null,
                        null,
                        null,
                        null,
                        Camera.get_transformation(Game.GraphicsDevice));
            Tiles.Draw( gameTime,spriteBatch);
            MapEntities.Draw(gameTime);
            
            spriteBatch.End();
        }


    }
}
